#!/usr/bin/python
# author:Yuyu
# 2025年03月21日

from fastapi import APIRouter,Request
from fastapi.openapi.docs import get_swagger_ui_html

router = APIRouter()

@router.get("/")
async def home(req:Request):

    return "fastapi"

# 自定义 Swagger UI 路由
@router.get("/docs", include_in_schema=False)
async def custom_swagger_ui():
    return get_swagger_ui_html(
        openapi_url="/openapi.json",
        title="API Docs",
        swagger_js_url="/static/swagger-ui-bundle.js",  # 本地 JS
        swagger_css_url="/static/swagger-ui.css",        # 本地 CSS
        swagger_favicon_url="/static/favicon.png"        # 本地 favicon
    )
